---
title: Get a prompt
description: Learn how to get a prompt with the Latitude SDK
---

## Code

You can retrieve a prompt from one of your Latitude projects. This is useful if you want to render the prompt in the format expected by the LLM you're using and call it directly.

<CodeGroup>
````typescript Typescript
import { Latitude } from '@latitude-data/sdk'

async function run() {
  const sdk = new Latitude(process.env.LATITUDE_API_KEY, {
    projectId: Number(process.env.PROJECT_ID),
    versionUuid: 'live',
  })

  const response = await sdk.prompts.get('get-prompt/example')
  console.log('Prompt: ', response)
}

run()
````
````python Python
import asyncio
import os

from latitude_sdk import Latitude, LatitudeOptions

async def run():
    api_key = os.getenv("LATITUDE_API_KEY")
    sdk_options = LatitudeOptions(
        project_id=int(os.getenv("PROJECT_ID")),
        version_uuid="live",
    )
    sdk = Latitude(api_key, sdk_options)
    try:
        result = await sdk.prompts.get("get-prompt/example")
    except Exception as e:
        print(f"Error: {e}")
        return

    if result:
        # Also you can wait for the result
        print(result, "\n" * 2)


asyncio.run(run())
````
</CodeGroup>
